import type { TableColumnCtx } from 'element-plus'

export interface TableOptions {
  label: string
  prop: string
  align?: 'left' | 'center' | 'right'
  width?: string | number
  slot?: string
  editable?: boolean
  action?: boolean
}

export interface TableScope<T = any> {
  row: T & { isEditRow?: boolean; rowEdit?: boolean }
  column: TableColumnCtx<T>
  $index: number
}

export interface TableEmits {
  (e: 'confirm', scope: TableScope): void
  (e: 'cancel', scope: TableScope): void
  (e: 'update:editRowIndex', index?: string): void
  (e: 'edit-click', scope: TableScope): void
}